<?php
class Product extends Base{

    public static $timestamps   =   true;

    public static $table        =   'products';

    public static $accessible   =   array('num_iid', 'seller_id', 'nick', 'title', 'price', 'item_location', 'seller_credit_score', 'click_url', 'shop_click_url', 'pic_url', 'taobaoke_cat_click_url', 'keyword_click_url', 'coupon_rate', 'coupon_price', 'coupon_start_time', 'coupon_end_title', 'commission_rate', 'commission', 'commission_num', 'commission_volume', 'volume', 'shop_type');

    public function collections() {
      return $this->has_many_and_belongs_to('Collection', 'collection_product');
    }

    public function imgs() {
      return $this->has_many('Img');
    }
}
